package com.example.learnconfigcli.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: zyb
 * @Date: 2018/11/8 15:43
 * @Description:
 */
@RestController
public class TestController {

    @Value("${from}")
    private String fromValue;

    @Value("${password}")
    private String password;

    @Value("${username}")
    private String username;

    @RequestMapping
    public String getFromValue() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(fromValue).append("--> username :");
        stringBuilder.append(password).append("--> passrword :");
        stringBuilder.append(username);
        return stringBuilder.toString();
    }
}
